<?php
namespace Common\Taglib;

class track
{
    public function run($opt)
    {
        $uid = $opt['uid'];
        if (!empty($uid)) {
            $map['uid'] = intval($uid);
        }
        $num = empty($opt['num']) ? 15 : intval($opt['num']);
        $sort = 'id DESC';
        $page = intval($opt['page']);
        $list = D('UserTrack')->get_list($map, $page, $sort, $num);
        file_put_contents(RUNTIME_PATH.'track_list.php', "<?php\n".var_export($list, true).';?>');
        return $list;
    }
}